package com.dy.lock.screen.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.dy.lock.screen.dao.UserDao;
import com.dy.lock.screen.pojo.UserInfo;

@Repository("userDao")
public class UserDaoImpl extends BaseDaoImpl<UserInfo, String> implements
		UserDao {

	@Override
	public String getQueryNamespace() {
		return "mybatis.xml.UserMapper";
	}

	@Override
	public UserInfo queryByMyInviteCode(String myInviteCode) {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectOne(
				getQueryNamespace() + ".queryByMyInviteCode", myInviteCode);
	}

	@Override
	public int updatePwd(UserInfo info) {
		// TODO Auto-generated method stub
		return this.getSqlSession().update(getQueryNamespace() + ".updatePwd",
				info);
	}

	@Override
	public UserInfo queryByMobile(String mobile) {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectOne(
				getQueryNamespace() + ".queryByMobile", mobile);
	}

	@Override
	public int UpdateAccount(UserInfo info) {
		// TODO Auto-generated method stub
		return this.getSqlSession().update(getQueryNamespace() + ".update",
				info);
	}

	@Override
	public UserInfo queryByUserId(String userId) {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectOne(
				getQueryNamespace() + ".queryByUserId", userId);
	}

	@Override
	public List<UserInfo> getUserListByUserIds(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectList(
				getQueryNamespace() + ".getUserListByUserIds", para);
	}

	@Override
	public UserInfo queryPersonalInfoByUserId(String userId) {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectOne(
				getQueryNamespace() + ".queryPersonalInfoByUserId", userId);
	}

	@Override
	public List<UserInfo> getUserListByMobiles(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectList(
				getQueryNamespace() + ".getUserListByMobiles", para);
	}

	@Override
	public List<String> getUserIdList(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectList(
				getQueryNamespace() + ".getUserIdList", para);
	}

	@Override
	public List<UserInfo> queryFansOfOnehundred() {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectList(
				getQueryNamespace() + ".queryFansOfOnehundred");
	}

}
